package com.zxg.util;

import java.io.Serializable;

/**
 * configs about api
 * 
 * @author HD
 * 
 */
public class WeixinApiConfigs {

  /**
   * configmanger 初始化的时候 会替换掉 appkey 和 secret
   */

  public static String APP_MODULE_ZXGHB   = "zxg";
  public static String APP_KEY_ZXGHB      = "wxa82a11f5d01a6268";
  public static String APP_SECRET_ZXGHB   = "d9f62bd06668727e8b5d565393529267";
  public static String REDIRECT_URI_ZXGHB = "http://media.zhixiangge.com/seller/";
  public static String ZXGHB_DOMAIN       = "media.zhixiangge.com";
  public static String APP_TOKEN_ZXGHB    = "zhixiangge";
  public static String APP_AESKEY_ZXGHB   = "zxcvbnmlkjhgfdsaqwertyuiop0987654321qwertyu";

  public static ComponentInfo getAppInfoByApp(WeixinComponent app) {
    switch (app) {
    case ZXG:
      return new ComponentInfo(APP_KEY_ZXGHB, APP_SECRET_ZXGHB, APP_TOKEN_ZXGHB, APP_AESKEY_ZXGHB, REDIRECT_URI_ZXGHB);
    default:
      return new ComponentInfo(APP_KEY_ZXGHB, APP_SECRET_ZXGHB, APP_TOKEN_ZXGHB, APP_AESKEY_ZXGHB, REDIRECT_URI_ZXGHB);
    }
  }

  public static class ComponentInfo implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String            appId;
    private String            appSecret;
    private String            token;
    private String            aesKey;
    private String            redirectUrl;

    public String getAppId() {
      return appId;
    }

    public void setAppId(String appId) {
      this.appId = appId;
    }

    public String getAppSecret() {
      return appSecret;
    }

    public void setAppSecret(String appSecret) {
      this.appSecret = appSecret;
    }

    public String getToken() {
      return token;
    }

    public void setToken(String token) {
      this.token = token;
    }

    public String getAesKey() {
      return aesKey;
    }

    public void setAesKey(String aesKey) {
      this.aesKey = aesKey;
    }

    public String getRedirectUrl() {
      return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
      this.redirectUrl = redirectUrl;
    }

    public ComponentInfo(String appId, String appSecret, String token, String aesKey, String redirectUrl) {
      super();
      this.appId = appId;
      this.appSecret = appSecret;
      this.token = token;
      this.aesKey = aesKey;
      this.redirectUrl = redirectUrl;
    }

  }
}
